<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0056)http://blog.csdn.net/zhouyuqwert/article/details/6603124 -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>查询Active Directory(LDAP) - 周绍禹-whuiss - 博客频道 - CSDN.NET</title>

<meta name="description" content="实验条件：         一台server2003作为证书服务器，域控制器以及AD服务器         服务器上需要安装server2003工具集，在安装包的SUPPORT/TOOLs文件夹下,SUPTOOLS.MSI为安装文件，然后找到工具集中的ldp.exe">
<script type="text/javascript" async="" src="./遍历AD_files/ga.js"></script><script src="./遍历AD_files/jquery.js" type="text/javascript"></script>
<script type="text/javascript" src="./遍历AD_files/ad.js"></script>
<link rel="Stylesheet" type="text/css" href="./遍历AD_files/style.css">
<link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://blog.csdn.net/zhouyuqwert/rss/list">
<link rel="shortcut icon" href="http://blog.csdn.net/favicon.ico">
<link type="text/css" rel="stylesheet" href="./遍历AD_files/blue_green.css">
<link type="text/css" rel="stylesheet" href="./遍历AD_files/style(1).css"></head>
<body>
<script src="./遍历AD_files/pub_topnav_2011.js" type="text/javascript"></script><link rel="stylesheet" type="text/css" href="./遍历AD_files/navtop_2012.css">
<div class="nav_top_2011">
<p><span style="color:red;">您还未登录！</span>|<a href="https://passport.csdn.net/account/login" target="_top">登录</a>|<a href="https://passport.csdn.net/account/register" target="_top">注册</a>|<a href="https://passport.csdn.net/help/faq" target="_blank">帮助</a></p><ul>
<li><a href="http://www.csdn.net/" target="_blank">首页</a></li>
<li><a href="http://news.csdn.net/" target="_blank">业界</a></li>
<li><a href="http://mobile.csdn.net/" target="_blank">移动</a></li>
<li><a href="http://cloud.csdn.net/" target="_blank">云计算</a></li>
<li><a href="http://sd.csdn.net/" target="_blank">研发</a></li>
<li><a href="http://bbs.csdn.net/" target="_blank">论坛</a></li>
<li><a href="http://blog.csdn.net/" target="_blank">博客</a></li>
<li><a href="http://download.csdn.net/" target="_blank">下载</a></li>
<li class="more"><h2 id="topnav_btnmore" onclick="showNavMore(this)"><a href="javascript:void(0);">更多</a></h2>
<div id="topnav_hidlist">
<iframe name="nav_frm" src="about:blank" width="92" height="178" scrolling="no" frameborder="no"></iframe>
</div>
</li>
</ul>
</div>


<div id="container">
<div id="header">
    <div class="header">
        <div id="blog_title">
            <h1><a href="http://blog.csdn.net/zhouyuqwert">周绍禹-whuiss</a></h1>
            <h2>take everything coolly</h2>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg"></div>
    <div class="navigator">
        <ul>
            <li id="btnContents"><a href="http://blog.csdn.net/zhouyuqwert?viewmode=contents"><span><img src="./遍历AD_files/ico_list.gif">目录视图</span></a></li>
            <li id="btnView"><a href="http://blog.csdn.net/zhouyuqwert?viewmode=list"><span><img src="./遍历AD_files/ico_summary.gif">摘要视图</span></a></li>
            <li id="btnRss"><a href="http://blog.csdn.net/zhouyuqwert/rss/list"><span><img src="./遍历AD_files/ico_rss.gif">订阅</span></a></li>
</ul>
    </div>
</div>
<script type="text/javascript">
    var username = "zhouyuqwert";
    var blog_address = "http://blog.csdn.net/zhouyuqwert";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "";
</script>
        
<div id="body">
<div id="main">
<div class="main">
<div class="notice"> 

<a href="http://surveies.csdn.net/survey/comein/532" target="_blank">
<font color="blue">博客专家信息更新登记表   </font></a>



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/blogdevteam/article/details/8572108" target="_blank"><font color="red">社区专家谈 12306</font></a>

&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://bbs.csdn.net/topics/390373496" target="_blank"><font color="red">CSDN社区程序员回乡见闻活动火爆开始！

</font></a>

<br>





<a href="http://www.csdn.net/article/2013-03-05/2814348" target="_blank">
<font color="red">专访陈勇： 敏捷开发现状及发展之路

 </font></a>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://huiyi.csdn.net/tech/view/223" target="_blank">
<font color="red">“传统商家移动化之路”会议
 </font></a>



&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<a href="http://blog.csdn.net/csdnstudent/article/details/8077932" target="_blank">
<font color="red">2013年全国百所高校巡讲讲师招募  </font></a>


</div><div id="article_details" class="details">
    <div class="article_title">
    <span class="ico ico_type_Original"></span>
    <h3>
        <span class="link_title"><a href="./遍历AD_files/遍历AD.htm">
        查询Active Directory(LDAP)
        </a></span>
    </h3>
</div>

        
    <div class="article_manage">
        <span class="link_categories">
        分类：
            <a href="http://blog.csdn.net/zhouyuqwert/article/category/743221">web开发</a> 
        </span>
    <span class="link_postdate">2011-07-13 15:45</span>
    <span class="link_view" title="阅读次数">923人阅读</span>
    <span class="link_comments" title="评论次数"><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#comments">评论</a>(2)</span>
    <span class="link_collect"><a href="javascript:void(0);" onclick="javascript:collectArticle(&#39;查询Active Directory(LDAP)&#39;,&#39;6603124&#39;);return false;" title="收藏">收藏</a></span>
    <span class="link_report"><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#report" onclick="javascript:report(6603124,2);return false;" title="举报">举报</a></span>
    
</div>
<div class="tag2box"><a href="http://blog.csdn.net/tag/details.html?tag=properties" target="_blank">properties</a><a href="http://blog.csdn.net/tag/details.html?tag=byte" target="_blank">byte</a><a href="http://blog.csdn.net/tag/details.html?tag=credentials" target="_blank">credentials</a><a href="http://blog.csdn.net/tag/details.html?tag=%e6%9c%8d%e5%8a%a1%e5%99%a8" target="_blank">服务器</a><a href="http://blog.csdn.net/tag/details.html?tag=string" target="_blank">string</a><a href="http://blog.csdn.net/tag/details.html?tag=authentication" target="_blank">authentication</a></div>


    
<div id="article_content" class="article_content">
<p>实验条件：</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一台server2003作为证书服务器，域控制器以及AD服务器</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 服务器上需要安装server2003工具集，在安装包的SUPPORT/TOOLs文件夹下,SUPTOOLS.MSI为安装文件，然后找到工具集中的ldp.exe</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一台客户机</p><p>实验步骤：</p><p>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在AD服务器上为客户机添加账号，设置密码以及相关信息</p><p>2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在客户机登录该域账号后进入证书申请页面申请相应证书存储至系统或存储到智能卡</p><p>3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通过ldap地址查找AD服务器上的用户对象（可用ldp工具进行查找测试），其中有一属性名为userCertificate，值为byte数组，我们可获取后将其转换为base64码，在需要使用时解码得到二进制数组并可转换成对应证书对象。</p><p>LDP工具查询演示：</p><p></p><p>1.Connection -&gt; Connect 连接相应的域，Server为计算机名，Port默认为389</p><p><img src="./遍历AD_files/0_131054310147N3.gif" alt="" height="377" width="537"><br></p><p>2.Connection -&gt; Bind 绑定域账号</p><p><img src="./遍历AD_files/0_1310543125uyAp.gif" alt="" height="359" width="516"><br></p><p>3. View -&gt; Tree 查看LDAP指定节点（下图为指定节点的属性显示，可看见userCertificate属性）</p><p><img src="./遍历AD_files/0_13105431526f68.gif" alt="" height="313" width="337"><br></p><p>下图为查询CRL分发点（CDP），可以看到CRL和deltaCRL</p><img src="./遍历AD_files/0_1310543163Nmnv.gif" alt="" height="290" width="338"><br><p>C#代码片段<br></p><div class="dp-highlighter bg_csharp"><div class="bar"><div class="tools"><b>[csharp]</b> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><div style="position: absolute; left: 443px; top: 2207px; width: 29px; height: 14px; z-index: 99;"><embed id="ZeroClipboardMovie_1" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="29" height="14" name="ZeroClipboardMovie_1" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&amp;width=29&amp;height=14" wmode="transparent"></div></div></div><ol start="1" class="dp-c"><li class="alt"><span><span>&lt;pre&nbsp;name=</span><span class="string">"code"</span><span>&nbsp;</span><span class="keyword">class</span><span>=</span><span class="string">"csharp"</span><span>&gt;</span><span class="comment">//该函数主要用作查找当前对象的属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">private</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;GetChildren(DirectoryEntry&nbsp;entry,&nbsp;TreeNode&nbsp;entryNode)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PropertyCollection&nbsp;properties&nbsp;=&nbsp;entry.Properties;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">foreach</span><span>&nbsp;(</span><span class="keyword">string</span><span>&nbsp;name&nbsp;</span><span class="keyword">in</span><span>&nbsp;properties.PropertyNames)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//输出所有属性名及值</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">foreach</span><span>&nbsp;(</span><span class="keyword">object</span><span>&nbsp;o&nbsp;</span><span class="keyword">in</span><span>&nbsp;properties[name])&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//如果属性名为userCertificate&nbsp;即用户证书属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(name&nbsp;==&nbsp;</span><span class="string">"userCertificate"</span><span>)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;":&nbsp;"&nbsp;+&nbsp;o.ToString());</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte[]&nbsp;caCert_byte&nbsp;=&nbsp;o&nbsp;<span class="keyword">as</span><span>&nbsp;Byte[];&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">string</span><span>&nbsp;caCert_base&nbsp;=&nbsp;Convert.ToBase64String(caCert_byte);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;<span class="string">":&nbsp;"</span><span>&nbsp;+&nbsp;caCert_base);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//其他属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;<span class="string">":&nbsp;"</span><span>&nbsp;+&nbsp;o.ToString());&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//以下代码为ldap链接语句</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">using</span><span>&nbsp;(DirectoryEntry&nbsp;root&nbsp;=&nbsp;</span><span class="keyword">new</span><span>&nbsp;DirectoryEntry())&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root.Path&nbsp;=&nbsp;"LDAP://iss-b79167109c6:389/DC=iss,DC=whu";</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//ldap地址，查找用户对象，也可从根目录DC=iss,DC=whu开始查找&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>root.Path&nbsp;=&nbsp;<span class="string">"LDAP://iss-b79167109c6:389/CN=CN_Name,CN=Users,DC=iss,DC=whu"</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TreeNode&nbsp;node&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;TreeNode(root.Name);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treeView1.Nodes.Add(node);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TreeNode&nbsp;node1&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;TreeNode(</span><span class="string">"properties"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node.Nodes.Add(node1);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetChildren(root,&nbsp;node1);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;this.treeView1.ExpandAll();</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&lt;/pre&gt;&lt;br&gt;&nbsp;&nbsp;</span></li></ol></div><pre name="code" class="csharp" style="display: none;"><div class="dp-highlighter bg_csharp"><div class="bar"><div class="tools"><b>[csharp]</b> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><div style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index: 99;"><embed id="ZeroClipboardMovie_2" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="0" height="0" name="ZeroClipboardMovie_2" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&amp;width=0&amp;height=0" wmode="transparent"></div></div></div><ol start="1" class="dp-c"><li class="alt"><span><span class="comment">//该函数主要用作查找当前对象的属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">private</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;GetChildren(DirectoryEntry&nbsp;entry,&nbsp;TreeNode&nbsp;entryNode)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PropertyCollection&nbsp;properties&nbsp;=&nbsp;entry.Properties;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">foreach</span><span>&nbsp;(</span><span class="keyword">string</span><span>&nbsp;name&nbsp;</span><span class="keyword">in</span><span>&nbsp;properties.PropertyNames)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//输出所有属性名及值</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">foreach</span><span>&nbsp;(</span><span class="keyword">object</span><span>&nbsp;o&nbsp;</span><span class="keyword">in</span><span>&nbsp;properties[name])&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//如果属性名为userCertificate&nbsp;即用户证书属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(name&nbsp;==&nbsp;</span><span class="string">"userCertificate"</span><span>)&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;":&nbsp;"&nbsp;+&nbsp;o.ToString());</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte[]&nbsp;caCert_byte&nbsp;=&nbsp;o&nbsp;<span class="keyword">as</span><span>&nbsp;Byte[];&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">string</span><span>&nbsp;caCert_base&nbsp;=&nbsp;Convert.ToBase64String(caCert_byte);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;<span class="string">":&nbsp;"</span><span>&nbsp;+&nbsp;caCert_base);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//其他属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">else</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;entryNode.Nodes.Add(name&nbsp;+&nbsp;<span class="string">":&nbsp;"</span><span>&nbsp;+&nbsp;o.ToString());&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//以下代码为ldap链接语句</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">using</span><span>&nbsp;(DirectoryEntry&nbsp;root&nbsp;=&nbsp;</span><span class="keyword">new</span><span>&nbsp;DirectoryEntry())&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root.Path&nbsp;=&nbsp;"LDAP://iss-b79167109c6:389/DC=iss,DC=whu";</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//ldap地址，查找用户对象，也可从根目录DC=iss,DC=whu开始查找&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>root.Path&nbsp;=&nbsp;<span class="string">"LDAP://iss-b79167109c6:389/CN=CN_Name,CN=Users,DC=iss,DC=whu"</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TreeNode&nbsp;node&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;TreeNode(root.Name);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treeView1.Nodes.Add(node);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TreeNode&nbsp;node1&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;TreeNode(</span><span class="string">"properties"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node.Nodes.Add(node1);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetChildren(root,&nbsp;node1);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;&nbsp;&nbsp;&nbsp;this.treeView1.ExpandAll();</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre name="code" class="csharp" style="display: none;">//该函数主要用作查找当前对象的属性
	   private void GetChildren(DirectoryEntry entry, TreeNode entryNode)
        {
            PropertyCollection properties = entry.Properties;

            foreach (string name in properties.PropertyNames)
            {
				//输出所有属性名及值
                foreach (object o in properties[name])
                {
					//如果属性名为userCertificate 即用户证书属性
                    if (name == "userCertificate")
                    {
                        // entryNode.Nodes.Add(name + ": " + o.ToString());
                        Byte[] caCert_byte = o as Byte[];
                        string caCert_base = Convert.ToBase64String(caCert_byte);
                        entryNode.Nodes.Add(name + ": " + caCert_base);
                    }
					//其他属性
                    else
                    {
                        entryNode.Nodes.Add(name + ": " + o.ToString());
                    }
                }

            }
        }

	//以下代码为ldap链接语句
    using (DirectoryEntry root = new DirectoryEntry())
                {
               //     root.Path = "LDAP://iss-b79167109c6:389/DC=iss,DC=whu";
         //ldap地址，查找用户对象，也可从根目录DC=iss,DC=whu开始查找           
root.Path = "LDAP://iss-b79167109c6:389/CN=CN_Name,CN=Users,DC=iss,DC=whu";
                    TreeNode node = new TreeNode(root.Name);
                    treeView1.Nodes.Add(node);
                    TreeNode node1 = new TreeNode("properties");
                    node.Nodes.Add(node1);
                    GetChildren(root, node1);
               
                //    this.treeView1.ExpandAll();
                }</pre><br></pre>JAVA代码片段<br><div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><div style="position: absolute; left: 428px; top: 3054px; width: 29px; height: 14px; z-index: 99;"><embed id="ZeroClipboardMovie_3" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="29" height="14" name="ZeroClipboardMovie_3" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=3&amp;width=29&amp;height=14" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">import</span><span>&nbsp;java.util.Enumeration;&nbsp;&nbsp;</span></span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;java.util.Hashtable;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;javax.naming.*;&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.Attribute;&nbsp;&nbsp;</span></span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.Attributes;&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.DirContext;&nbsp;&nbsp;</span></span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.InitialDirContext;&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.SearchControls;&nbsp;&nbsp;</span></span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;javax.naming.directory.SearchResult;&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">import</span><span>&nbsp;javax.naming.ldap.InitialLdapContext;&nbsp;&nbsp;</span></span></li><li class=""><span><span class="keyword">import</span><span>&nbsp;javax.naming.ldap.LdapContext;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span><span class="keyword">public</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;test&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">/**</span>&nbsp;</span></li><li class=""><span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;args</span>&nbsp;</span></li><li class="alt"><span><span class="comment">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;main(String[]&nbsp;args)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">/*指定ldap链接参数及绑定账号密码*/</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hashtable&nbsp;env&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;Hashtable();&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env.put(Context.INITIAL_CONTEXT_FACTORY,<span class="string">"com.sun.jndi.ldap.LdapCtxFactory"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env.put(Context.PROVIDER_URL,&nbsp;<span class="string">"ldap://iss-b79167109c6:389"</span><span>);//链接地址&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env.put(Context.SECURITY_AUTHENTICATION,&nbsp;<span class="string">"simple"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env.put(Context.SECURITY_PRINCIPAL,&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="string">"CN=Administrator,CN=Users,DC=iss,DC=whu"</span><span>);</span><span class="comment">//账号</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env.put(Context.SECURITY_CREDENTIALS,&nbsp;<span class="string">""</span><span>);</span><span class="comment">//密码</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">try</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirContext&nbsp;ctx&nbsp;=&nbsp;<span class="keyword">new</span><span>&nbsp;InitialDirContext(env);&nbsp;</span><span class="comment">//初始化上下文</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SearchControls&nbsp;&nbsp;&nbsp;searchCons&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;<span class="keyword">new</span><span>&nbsp;&nbsp;&nbsp;SearchControls();&nbsp;</span><span class="comment">//搜索控件</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NamingEnumeration&nbsp;&nbsp;&nbsp;namingEnum&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;<span class="keyword">null</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searchCons.setSearchScope(SearchControls.SUBTREE_SCOPE);<span class="comment">//SUBTREE_SCOPE</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searchCons.setCountLimit(<span class="number">0</span><span>);</span><span class="comment">//设置最大返回个数</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;searchCons.setTimeLimit(<span class="number">0</span><span>);</span><span class="comment">//超时</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//搜索对象,第一个参数为基目录,第二个参数为fiter，fiter格式可类似于(&amp;(CN=*)(DC=*))</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;namingEnum&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;ctx.search(<span class="string">"CN=Users,DC=iss,DC=whu"</span><span>,&nbsp;&nbsp;&nbsp;</span><span class="string">"(CN=CN_Name)"</span><span>,&nbsp;&nbsp;&nbsp;searchCons);&nbsp;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//遍历搜索结果</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">while</span><span>&nbsp;(namingEnum.hasMore())&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;Use&nbsp;debug&nbsp;to&nbsp;see&nbsp;the&nbsp;attributes</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;obj&nbsp;=&nbsp;namingEnum.nextElement();&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SearchResult&nbsp;result&nbsp;=&nbsp;(SearchResult)&nbsp;obj;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//获取搜索结果对象的属性</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NamingEnumeration&nbsp;attrs&nbsp;=&nbsp;result.getAttributes().getAll();&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//遍历属性，将userCertificate的值转换为base64字符串输出</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">while</span><span>(attrs.hasMore()){&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attribute&nbsp;attr&nbsp;=&nbsp;(Attribute)attrs.next();&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>(attr.getID().endsWith(</span><span class="string">"userCertificate"</span><span>))&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println((<span class="keyword">new</span><span>&nbsp;sun.misc.BASE64Encoder()).encode((</span><span class="keyword">byte</span><span>[])attr.get()));&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span class="string">"--------------------------------------------"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//通过属性名称获取搜索结果对象的属性值</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attribute&nbsp;attr&nbsp;=&nbsp;result.getAttributes().get(<span class="string">"userCertificate"</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println((<span class="keyword">new</span><span>&nbsp;sun.misc.BASE64Encoder()).encode((</span><span class="keyword">byte</span><span>[])attr.get()));&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">catch</span><span>&nbsp;(NamingException&nbsp;e)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></div><pre name="code" class="java" style="display: none;">import java.util.Enumeration;
import java.util.Hashtable;

import javax.naming.*;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;

public class test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*指定ldap链接参数及绑定账号密码*/
		Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, "ldap://iss-b79167109c6:389");//链接地址
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL,
                                    "CN=Administrator,CN=Users,DC=iss,DC=whu");//账号
        env.put(Context.SECURITY_CREDENTIALS, "");//密码
        try {
                      DirContext ctx = new InitialDirContext(env); //初始化上下文
                      SearchControls   searchCons   =   new   SearchControls(); //搜索控件
                      NamingEnumeration   namingEnum   =   null;
                      searchCons.setSearchScope(SearchControls.SUBTREE_SCOPE);//SUBTREE_SCOPE
                      searchCons.setCountLimit(0);//设置最大返回个数
                      searchCons.setTimeLimit(0);//超时
                    //搜索对象,第一个参数为基目录,第二个参数为fiter，fiter格式可类似于(&amp;(CN=*)(DC=*))
                      namingEnum   =   ctx.search("CN=Users,DC=iss,DC=whu",   "(CN=CN_Name)",   searchCons); 
                      //遍历搜索结果
                      while (namingEnum.hasMore()) {
                                    // Use debug to see the attributes
                                    Object obj = namingEnum.nextElement();
                                    SearchResult result = (SearchResult) obj;
                                    //获取搜索结果对象的属性
                                    NamingEnumeration attrs = result.getAttributes().getAll();
                                    //遍历属性，将userCertificate的值转换为base64字符串输出
                                    while(attrs.hasMore()){
                                    	
                                    Attribute attr = (Attribute)attrs.next();
                                    if(attr.getID().endsWith("userCertificate"))
                                    System.out.println((new sun.misc.BASE64Encoder()).encode((byte[])attr.get()));
                                    }
                                    
                                    System.out.println("--------------------------------------------");
                                    //通过属性名称获取搜索结果对象的属性值
                                    Attribute attr = result.getAttributes().get("userCertificate");
                                    System.out.println((new sun.misc.BASE64Encoder()).encode((byte[])attr.get()));
                      }
        } catch (NamingException e) {
                      e.printStackTrace();
        }
	
	}
}
</pre><br><br>
</div>
<div class="share_buttons" id="sharePanel"><span>分享到：</span> <a name="sina" class="share_sina" title="分享到新浪微博"></a><a name="qq" class="share_qq" title="分享到腾讯微博"></a></div>
<!--192.168.1.236-->
<div class="article_next_prev">
    <li class="prev_article"><span>上一篇：</span><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603091">linux一些操作，记着给自己用的</a></li>
    <li class="next_article"><span>下一篇：</span><a href="http://blog.csdn.net/zhouyuqwert/article/details/6603268">openssl实现3des对称加密</a></li>
</div>


            <div id="digg" articleid="6603124">
            <dl id="btnDigg" class="digg digg_disable">
                <dt>顶</dt>
                <dd>0</dd>
            </dl>
            <dl id="btnBury" class="digg digg_disable">
                <dt>踩</dt>
                <dd>0</dd>
            </dl>
        </div>

</div>
<div id="ad_cen"><iframe id="ad_frm_0" frameborder="0" scrolling="no" style="border-width: 0px; overflow: hidden; width: 1167px; height: 95px;" src="./遍历AD_files/ad(1).htm"></iframe></div>
<script type="text/javascript">
    new Ad(4, 'ad_cen');
</script>
<div id="comment_title" class="panel_head">查看评论<a name="comments"></a></div>
<div id="comment_list"><dl class="comment_item comment_topic" id="comment_item_2299841"><dt class="comment_head" floor="1">1楼 <span class="user"><a class="username" href="http://blog.csdn.net/caomeiDD" target="_blank">caomeiDD</a> <span class="ptime">2012-07-25 16:45发表</span>  <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="2299841" username="caomeiDD"> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/caomeiDD" target="_blank"><img src="./遍历AD_files/3_caomeidd.jpg" width="40" height="40"></a></dd><dd class="comment_body">有没有C++的代码啊！！！</dd><dl class="comment_item comment_reply" id="comment_item_2307233"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/zhouyuqwert" target="_blank">Genke</a> <span class="ptime">2012-07-26 13:13发表</span>  <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="2307233" username="zhouyuqwert"> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/zhouyuqwert" target="_blank"><img src="./遍历AD_files/3_zhouyuqwert.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复caomeiDD：网上有c++ ldap的API，我没有用过，你可以去搜下的哈</dd></dl></dl><div class="clear"></div></div>
<div id="comment_bar" style="display: none;"></div>
<div id="comment_form"><div class="guest_link">您还没有登录,请<a href="javascript:void(0);" onclick="javascript:csdn.showLogin(function (dat) {js_logined(dat.data.userName);});">[登录]</a>或<a href="http://passport.csdn.net/account/register?from=http%3A%2F%2Fblog.csdn.net%2Fzhouyuqwert%2Farticle%2Fdetails%2F6603124">[注册]</a></div></div>
<div class="announce">* 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
<script type="text/javascript">
    var fileName = '6603124';
    var commentscount = 2;
    var islock = false
</script>
<script type="text/javascript" src="./遍历AD_files/comment.js"></script>
<div id="ad_bot"><iframe id="ad_frm_1" frameborder="0" scrolling="no" style="border-width: 0px; overflow: hidden; width: 1167px; height: 170px;" src="./遍历AD_files/ad(2).htm"></iframe></div>
<script type="text/javascript">
    new Ad(5, 'ad_bot');
</script>
<div id="report_dialog"></div>

<div id="d-top" style="">
<a id="d-top-a" href="http://blog.csdn.net/zhouyuqwert/article/details/6603124#" title="回到顶部">
<img src="./遍历AD_files/top.png" alt="TOP"></a>
</div>
<script type="text/javascript">
    $(function(){
        var d_top=$('#d-top');
        document.onscroll=function(){
            var scrTop=(document.body.scrollTop||document.documentElement.scrollTop);
            if(scrTop>500){
                d_top.show();
            }else{
                d_top.hide();
            }
        }
        $('#d-top-a').click(function(){
            scrollTo(0,0);
            this.blur();
            return false;
        });
    });
</script>



<div class="clear"></div>
</div>
</div>

<div id="side">
<div class="side">
<div id="panel_Profile" class="panel">
    <ul class="panel_head"><span>个人资料</span></ul>
    <ul class="panel_body profile">
        <div id="blog_userface">
            <a href="http://my.csdn.net/zhouyuqwert" target="_blank">
            <img src="./遍历AD_files/1_zhouyuqwert.jpg" title="访问我的空间" style="max-width:90%">
            </a>
            <br>
            <span><a href="http://my.csdn.net/zhouyuqwert" class="user_name" target="_blank">Genke</a></span>
        </div>
<div class="interact">
<!--<a href="#" class="attented" title="已关注"></a>-->
<a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]"></a>
<a href="javascript:void(0);" class="letter" onclick="loginto(1)" title="[发私信]"></a>
</div>
        <div id="blog_medal">
        <div id="bms_box"><a href="http://medal.blog.csdn.net/allmedal.aspx" target="_blank"><img src="./遍历AD_files/holdon_s2.gif" onmouseover="m_over_m(this,0)" onmouseout="m_out_m()" alt=""></a></div></div>
        <ul id="blog_rank">
            <li>访问：<span>42213次</span></li>
            <li>积分：<span>1006分</span></li>
            <li>排名：<span>第9496名</span></li>
        </ul>
        <ul id="blog_statistics">
            <li>原创：<span>53篇</span></li>
            <li>转载：<span>12篇</span></li>
            <li>译文：<span>0篇</span></li>
            <li>评论：<span>72条</span></li>
        </ul>
    </ul>
</div>
<script type="text/javascript">
    var _blogger = 'zhouyuqwert';
</script>



<div class="panel" id="panel_Search">
    <ul class="panel_head"><span>文章搜索</span></ul>
    <ul class="panel_body">
        <form id="frmSearch" action="http://so.csdn.net/search" class="form_search" target="_blank">
        <span><input id="inputSearch" type="text" class="blogsearch" title="请输入关键字"></span>
        <input id="btnSubmit" type="submit" value="搜索" title="search in blog">
        <input type="hidden" name="q" id="inputQ">
        <input type="hidden" name="t" value="blog">
        <a id="btnSearchBlog" target="_blank"></a>
        </form>
    </ul>
</div><div id="panel_Category" class="panel">
    <ul class="panel_head"><span>文章分类</span></ul>
    <ul class="panel_body">
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/812417">SSH学习笔记</a><span>(10)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/743221">web开发</a><span>(18)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/770764">编程之美随记</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/812594">面试</a><span>(4)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/845868">Android</a><span>(4)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/845894">Linux</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/845920">信息安全</a><span>(20)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/862257">domino相关</a><span>(3)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/880451">javaSE</a><span>(3)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/882451">JBPM</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/1216584">openstack</a><span>(1)</span>
        </li>
        <li>
        <a href="http://blog.csdn.net/zhouyuqwert/article/category/1317565">总结</a><span>(1)</span>
        </li>
    </ul>
</div><div id="panel_Archive" class="panel">
    <ul class="panel_head"><span>文章存档</span></ul>
    <ul class="panel_body">
        <div id="archive_list"><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2013/03">2013年03月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2013/01">2013年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2012/08">2012年08月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2012/04">2012年04月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2012/03">2012年03月</a><span>(5)</span></li><span class="hidelist" style="display:none;"><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2012/01">2012年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/11">2011年11月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/10">2011年10月</a><span>(3)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/09">2011年09月</a><span>(8)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/08">2011年08月</a><span>(5)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/07">2011年07月</a><span>(21)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/05">2011年05月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/04">2011年04月</a><span>(7)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2011/01">2011年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2010/12">2010年12月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/zhouyuqwert/article/month/2010/10">2010年10月</a><span>(5)</span></li></span><div id="archive_list_button" class="list_closed">展开</div></div>
    </ul>
</div>
<div id="hotarticls" class="panel">
    <ul class="panel_head"><span>阅读排行</span></ul>
    <ul class="panel_body itemlist">
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7387516" title="NPAPI——实现非IE浏览器的类似ActiveX的本地程序(插件)调用">NPAPI——实现非IE浏览器的类似ActiveX的本地程序(插件)调用</a><span>(3321)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6604572" title="C++基于ATL工程编写ActiveX控件">C++基于ATL工程编写ActiveX控件</a><span>(2505)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6765926" title="struts2几种result type探究">struts2几种result type探究</a><span>(1638)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603004" title="openssl移植Android使用及其相关经验分享">openssl移植Android使用及其相关经验分享</a><span>(1390)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/5977578" title="数字证书技术大全">数字证书技术大全</a><span>(1317)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6853730" title="Spring MVC中DispatcherServlet工作原理探究">Spring MVC中DispatcherServlet工作原理探究</a><span>(1294)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968" title="CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a><span>(1240)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603991" title="openssl签名验证、信封加密解密、产生随机数、md5摘要">openssl签名验证、信封加密解密、产生随机数、md5摘要</a><span>(1190)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6753438" title="JBPM5配置mysql持久化">JBPM5配置mysql持久化</a><span>(1122)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7354180" title="ActiveX打包cab实现浏览器提示安装注册控件">ActiveX打包cab实现浏览器提示安装注册控件</a><span>(1049)</span>
        </li>
    </ul>
</div>
<div id="hotarticls2" class="panel">
    <ul class="panel_head"><span>评论排行</span></ul>
    <ul class="panel_body itemlist">
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603004" title="openssl移植Android使用及其相关经验分享">openssl移植Android使用及其相关经验分享</a><span>(12)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968" title="CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a><span>(11)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7387516" title="NPAPI——实现非IE浏览器的类似ActiveX的本地程序(插件)调用">NPAPI——实现非IE浏览器的类似ActiveX的本地程序(插件)调用</a><span>(11)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7467296" title="CryptoAPI与openssl数字签名与验证交互">CryptoAPI与openssl数字签名与验证交互</a><span>(8)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6604572" title="C++基于ATL工程编写ActiveX控件">C++基于ATL工程编写ActiveX控件</a><span>(6)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/7882981" title="openstack单机ubuntu虚拟机环境安装部署经验及源码结构简单介绍(适合入门者)">openstack单机ubuntu虚拟机环境安装部署经验及源码结构简单介绍(适合入门者)</a><span>(4)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603091" title="linux一些操作，记着给自己用的">linux一些操作，记着给自己用的</a><span>(2)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6604609" title="C++调试ATL工程的ActiveX组件">C++调试ATL工程的ActiveX组件</a><span>(2)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6603991" title="openssl签名验证、信封加密解密、产生随机数、md5摘要">openssl签名验证、信封加密解密、产生随机数、md5摘要</a><span>(2)</span>
        </li>
        <li>
            <a href="http://blog.csdn.net/zhouyuqwert/article/details/6632710" title="ScienceWord控件问题以及IE8对于base64编码图片长度限制的解决方案">ScienceWord控件问题以及IE8对于base64编码图片长度限制的解决方案</a><span>(2)</span>
        </li>
    </ul>
</div>
<div id="homepageArticles" class="panel">
    <ul class="panel_head"><span>推荐文章</span></ul>
    <ul class="panel_body" id="ad_commend">
    <iframe id="ad_frm_2" frameborder="0" scrolling="no" style="border-width: 0px; overflow: hidden; width: 194px; height: 236px;" src="./遍历AD_files/ad.htm"></iframe></ul>
</div>
<script type="text/javascript">
    new Ad(12, 'ad_commend');
</script><div id="newcomments" class="panel">
<ul class="panel_head"><span>最新评论</span></ul>
<ul class="panel_body itemlist">
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7387516#comments">NPAPI——实现非IE浏览器的类似ActiveX的本地程序(插件)调用</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/zlandme" class="user_name">zlandme</a>:
@zhouyuqwert:请问怎么通过npapi插件调用ocx插件啊？还有就是怎么能让npapi插件...
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
这个加密可以用私钥加密，公钥解密吧。没有说一定是公钥加密私钥解密，对吧？
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
为什么运行你的这个函数出现这个问题：无法定位序数 4119 于动态链接库LIBEAY32.dll上？
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
@zhouyuqwert:谢谢你。疑惑还真是挺多的呢。
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/zhouyuqwert" class="user_name">Genke</a>:
@cogbee:如果你是用openssl生成的私钥，openssl本身就支持读取转成EVP_PKEY...
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/zhouyuqwert" class="user_name">Genke</a>:
@cogbee:if(EVP_PKEY_encrypt(ctx,NULL,&amp;cOut,in,cIn)...
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
unsigned int &amp;cOut，这个参数怎么定义？传什么样的类型的值？
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
我有看过你的上面这个加密函数。但是有几个参数我是拿不准。
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
@cogbee:不知道我有没有说清楚。
    </p>
    </li>
    <li>
    <a href="http://blog.csdn.net/zhouyuqwert/article/details/7462968#comments">CryptoAPI与openssl RSA非对称加密解密(PKCS1 PADDING)交互</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/cogbee" class="user_name">cogbee</a>:
@zhouyuqwert:很多RSA加密解密都是新生成的RSA结构，但是我的是私钥已经写在文件中了，...
    </p>
    </li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>

<div class="clear"></div>
</div>

<script type="text/javascript" src="./遍历AD_files/newblog.min.js"></script>
<script type="text/javascript" src="./遍历AD_files/showblogmedal.ashx"></script>

<script type="text/javascript" src="./遍历AD_files/publib_footer.js"></script><link rel="stylesheet" type="text/css" href="./遍历AD_files/pub_footer_2012.css"><div class="pub_footerall"><dl><dt></dt> <dd><a href="http://www.csdn.net/company/about.html" target="_blank">公司简介</a>|<a href="http://www.csdn.net/company/recruit.html" target="_blank">招贤纳士</a>|<a href="http://www.csdn.net/company/marketing.html" target="_blank">广告服务</a>|<a href="http://www.csdn.net/company/account.html" target="_blank">银行汇款帐号</a>|<a href="http://www.csdn.net/company/contact.html" target="_blank">联系方式</a>|<a href="http://www.csdn.net/company/statement.html" target="_blank">版权声明</a>|<a href="http://www.csdn.net/company/layer.html" target="_blank">法律顾问</a>|<a href="mailto:webmaster@csdn.net">问题报告</a></dd><dd>京&nbsp;ICP&nbsp;证&nbsp;070598&nbsp;号</dd><dd>北京创新乐知信息技术有限公司 版权所有</dd><dd>世纪乐知(北京)网络技术有限公司 提供技术支持</dd><dd>江苏乐知网络技术有限公司 提供商务支持</dd><dd><img src="./遍历AD_files/ico_email.gif" alt="" title=""> 联系邮箱：webmaster(at)csdn.net</dd><dd>Copyright © 1999-2012, CSDN.NET, All Rights Reserved&nbsp;<a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" target="_blank"><img src="./遍历AD_files/gongshang_logos.gif" alt="GongshangLogo" title=""></a></dd></dl></div><script type="text/javascript" charset="utf-8" src="./遍历AD_files/tracking.js"></script>

<script type="text/javascript" src="./遍历AD_files/login.js"></script>
<script type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</script><img src="./遍历AD_files/pv.aspx" border="0" width="0" height="0">
<script type="text/javascript" src="./遍历AD_files/counter.js"></script><script type="text/javascript" charset="UTF-8" src="./遍历AD_files/msg.popup.js"></script>


<script type="text/javascript" src="./遍历AD_files/ad-blog.js"></script><script type="text/javascript" src="./遍历AD_files/ad-ms467.js"></script>

</div>

<iframe style="width: 1px; height: 1px; position: absolute; visibility: hidden;" src="./遍历AD_files/mm-cloud-newshomepage-760-90-0304.htm"></iframe><link href="./遍历AD_files/message_pop.css" rel="stylesheet" type="text/css"><div style="display: block;" id="_popup_msg_container">

<div wistate="max" id="im_popupWindow_miniMsg" class="im_popupWindow" style="display: block; height: 240px;">
	<h6 class="wi_draggable"><span>
</span><a onclick="_message_tips_pop(&#39;down&#39;);return false;"><img alt="close" class="founctionpic3" src="./遍历AD_files/pic_close.gif"></a></h6>
    <div id="im_popupWindow_miniMsgContent" class="wi_content">
		<div class="kuai">
			<div style="width:280px;"><a href="http://linuxsurvey.csdn.net/" target="_blank"><img src="./遍历AD_files/280-188(1).jpg" alt="" border="0" style="border:0;" title=""></a></div>
		</div>
	</div>
	<div class="content_qq"><span onclick="window.open(&#39;https://itunes.apple.com/cn/app/cheng-xu-yuan-za-zhi/id544773337&#39;)" target="_blank"></span>
 </div>
 
 
</div>
</div><img src="./遍历AD_files/count_new.php" style="display: none;"></body></html>